#!/bin/sh
echo "Fetching ip's from auth.log:"
cat /var/log/auth.log | grep -Eo '([0-9]{1,3}\.){3}[0-9]{1,3}' | sed -n -e ":a" -e "$ s/\n/ /gp;N;b a" | sed 's|0.0.0.0||g' | fold -s18 | uniq | sort -u > ~/bin/ips.txt
cat ~/bin/ips.txt
